<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Voya Media: MediaInfo.cs Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Voya Media
   &#160;<span id="projectnumber">1.2.255.1212</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.8.0 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00017.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">MediaInfo.cs</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00017.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 ﻿using System;
<a name="l00002"></a>00002 <span class="keyword">using</span> System.Collections.Generic;
<a name="l00003"></a>00003 <span class="keyword">using</span> System.Diagnostics;
<a name="l00004"></a>00004 <span class="keyword">using</span> System.Linq;
<a name="l00005"></a>00005 <span class="keyword">using</span> System.Reflection;
<a name="l00006"></a>00006 <span class="keyword">using</span> System.Resources;
<a name="l00007"></a>00007 <span class="keyword">using</span> System.Text;
<a name="l00008"></a>00008 <span class="keyword">using</span> System.Text.RegularExpressions;
<a name="l00009"></a>00009 
<a name="l00010"></a><a class="code" href="a00026.html">00010</a> <span class="keyword">namespace </span>MediaInfoApi
<a name="l00011"></a>00011 {
<a name="l00012"></a>00012     <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">class </span>MediaInfo
<a name="l00013"></a>00013     {
<a name="l00014"></a>00014         <span class="comment">// Private class member properties.</span>
<a name="l00015"></a>00015         <span class="keyword">private</span> <span class="keyword">static</span> ResourceManager resourceManager = <span class="keyword">new</span> ResourceManager(<span class="stringliteral">&quot;MediaInfoApi.Properties.Resources&quot;</span>, Assembly.GetExecutingAssembly());
<a name="l00016"></a>00016 
<a name="l00017"></a>00017         <span class="comment">// MediaType structure.</span>
<a name="l00018"></a><a class="code" href="a00008.html">00018</a>         <span class="keyword">public</span> <span class="keyword">struct </span><a class="code" href="a00008.html">MediaType</a>
<a name="l00019"></a>00019         {
<a name="l00020"></a><a class="code" href="a00008.html#a472cdb3a1ce40f28b4ac96a95b9716df">00020</a>             <span class="keyword">public</span> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="a00008.html#a472cdb3a1ce40f28b4ac96a95b9716df">Audio</a>   = <span class="stringliteral">&quot;audio&quot;</span>;
<a name="l00021"></a><a class="code" href="a00008.html#a3913f7edb869bbc05f41fde907b5fe5b">00021</a>             <span class="keyword">public</span> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="a00008.html#a3913f7edb869bbc05f41fde907b5fe5b">Picture</a> = <span class="stringliteral">&quot;pictures&quot;</span>;
<a name="l00022"></a><a class="code" href="a00008.html#a7cea318c14b24b43171380f5f060d10c">00022</a>             <span class="keyword">public</span> <span class="keyword">const</span> <span class="keywordtype">string</span> <a class="code" href="a00008.html#a7cea318c14b24b43171380f5f060d10c">Video</a>   = <span class="stringliteral">&quot;videos&quot;</span>;
<a name="l00023"></a>00023         }
<a name="l00024"></a>00024 
<a name="l00030"></a>00030         <span class="keyword">public</span> <span class="keyword">static</span> <span class="keywordtype">string</span> RemoveHtmlTags(<span class="keywordtype">string</span> inputString)
<a name="l00031"></a>00031         {
<a name="l00032"></a>00032             <span class="comment">// Remove html tags.</span>
<a name="l00033"></a>00033             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;br&gt;&quot;</span>,   <span class="stringliteral">&quot;&quot;</span>);
<a name="l00034"></a>00034             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;br /&gt;&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00035"></a>00035             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;b&gt;&quot;</span>,    <span class="stringliteral">&quot;&quot;</span>);
<a name="l00036"></a>00036             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;/b&gt;&quot;</span>,   <span class="stringliteral">&quot;&quot;</span>);
<a name="l00037"></a>00037             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;i&gt;&quot;</span>,    <span class="stringliteral">&quot;&quot;</span>);
<a name="l00038"></a>00038             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;/i&gt;&quot;</span>,   <span class="stringliteral">&quot;&quot;</span>);
<a name="l00039"></a>00039             inputString = inputString.Replace(<span class="charliteral">&#39;+&#39;</span>,      <span class="charliteral">&#39; &#39;</span>);
<a name="l00040"></a>00040 
<a name="l00041"></a>00041             <span class="comment">// Remove &lt;a href=&#39;URL&#39;&gt; tags.</span>
<a name="l00042"></a>00042             <span class="keywordtype">string</span>          aHrefPattern = <span class="stringliteral">@&quot;&lt;a href=(&#39;|&quot;&quot;)\w+://(\w|\d|\.|-|_|\s|%|/)+(&#39;|&quot;&quot;)\s*&gt;&quot;</span>;
<a name="l00043"></a>00043             MatchCollection aHrefMatches = Regex.Matches(inputString, aHrefPattern);
<a name="l00044"></a>00044 
<a name="l00045"></a>00045             <span class="keywordflow">foreach</span> (Match aHrefMatch <span class="keywordflow">in</span> aHrefMatches)
<a name="l00046"></a>00046             {
<a name="l00047"></a>00047                 inputString = inputString.Replace(aHrefMatch.ToString(), <span class="stringliteral">&quot;&quot;</span>);
<a name="l00048"></a>00048             }
<a name="l00049"></a>00049 
<a name="l00050"></a>00050             <span class="comment">// Remove closing &lt;/a&gt; tags.</span>
<a name="l00051"></a>00051             inputString = inputString.Replace(<span class="stringliteral">@&quot;&lt;/a&gt;&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00052"></a>00052             
<a name="l00053"></a>00053             <span class="comment">// Return the trimmed string.</span>
<a name="l00054"></a>00054             <span class="keywordflow">return</span> inputString;
<a name="l00055"></a>00055         }
<a name="l00056"></a>00056 
<a name="l00062"></a>00062         <span class="keyword">public</span> <span class="keyword">static</span> <span class="keywordtype">string</span> RemoveSpecialCharacters(<span class="keywordtype">string</span> inputString)
<a name="l00063"></a>00063         {
<a name="l00064"></a>00064             <span class="comment">// Remove special characters.</span>
<a name="l00065"></a>00065             inputString = inputString.Replace(<span class="charliteral">&#39;.&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00066"></a>00066             inputString = inputString.Replace(<span class="charliteral">&#39;_&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00067"></a>00067             inputString = inputString.Replace(<span class="charliteral">&#39;-&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00068"></a>00068             inputString = inputString.Replace(<span class="charliteral">&#39;+&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00069"></a>00069             inputString = inputString.Replace(<span class="charliteral">&#39;!&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00070"></a>00070             inputString = inputString.Replace(<span class="charliteral">&#39;&quot;&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00071"></a>00071             inputString = inputString.Replace(<span class="charliteral">&#39;\&#39;&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00072"></a>00072             inputString = inputString.Replace(<span class="charliteral">&#39;$&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00073"></a>00073             inputString = inputString.Replace(<span class="charliteral">&#39;%&#39;</span>, <span class="charliteral">&#39; &#39;</span>);
<a name="l00074"></a>00074             inputString = inputString.Replace(<span class="stringliteral">&quot;(&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00075"></a>00075             inputString = inputString.Replace(<span class="stringliteral">&quot;)&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00076"></a>00076             inputString = inputString.Replace(<span class="stringliteral">&quot;[&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00077"></a>00077             inputString = inputString.Replace(<span class="stringliteral">&quot;]&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00078"></a>00078             inputString = inputString.Replace(<span class="stringliteral">&quot;{&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00079"></a>00079             inputString = inputString.Replace(<span class="stringliteral">&quot;}&quot;</span>, <span class="stringliteral">&quot;&quot;</span>);
<a name="l00080"></a>00080 
<a name="l00081"></a>00081             <span class="comment">// Remove the trimmed string.</span>
<a name="l00082"></a>00082             <span class="keywordflow">return</span> inputString;
<a name="l00083"></a>00083         }
<a name="l00084"></a>00084     }
<a name="l00085"></a>00085 }
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00017.html">MediaInfo.cs</a>      </li>

    <li class="footer">Generated on Thu Jan 10 2013 07:05:17 for Voya Media by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.0 </li>
   </ul>
 </div>


</body>
</html>
